home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / propage / genies / donsgenies / don'sgenies / gridsizefrombox.pprx < prev    next >
Text File  |  1993-05-25  |  1KB  |  54 lines

  1. /* This Genie sets up a grid to match the size of a box, with snap enabled.
  2. Written by Don Cox  © August 92 Revised Feb 93. Not public domain. All rights reserved.  */
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7. address command
  8. call SafeEndEdit.rexx()
  9. call ppm_AutoUpdate(0)
  10. cr="0a"x
  11.  
  12. currentunits = ppm_GetUnits()
  13. box     = ppm_ClickOnBox("  Click on box for grid size.")
  14. if box  = 0 then exit_msg("No box selected")
  15. gsize = ppm_GetGridSize()
  16. gwidth = word(gsize,1)
  17. gheight = word(gsize,2)
  18. call ppm_SaveText("ram:gridsize",gsize)
  19. size = ppm_GetBoxSize(box)
  20. width = word(size,1)
  21. height = word(size,2)
  22. choice = ppm_Inform(3,"Set Grid size to match box...","Width","Height","Both")
  23. select
  24.     when choice = 0 then call ppm_SetGridSize(width,gheight)
  25.     when choice = 1 then call ppm_SetGridSize(gwidth,height)
  26.     otherwise call ppm_SetGridSize(width,height)
  27.     end
  28.  
  29.  
  30. call ppm_SetGrid(1)
  31.  
  32. call ppm_SetGridSnap(1)
  33.  
  34. call exit_msg()
  35.  
  36. end
  37.  
  38. error:
  39. syntax:
  40.     do
  41.     exit_msg("Genie failed due to error: "errortext(rc))
  42.     end
  43.  
  44. exit_msg:
  45.     do
  46.     parse arg message
  47.     if message ~= "" then
  48.     call ppm_Inform(1,message)
  49.     call ppm_ClearStatus()
  50.     call ppm_AutoUpdate(1)
  51.     exit
  52.     end
  53.  
  54.